/**
 * Created by huangxuehua on 2017/12/6.
 */
//$("header>a.goBack").click(function(){
//    window.history.go(-1)
//});
var dialog = new auiDialog();
var xpHome = new Vue({
    el: '#app',
    data: {
        afterSaleGoods: {}// 售后产品信息
    },
    methods: {
        getDate: function (time) {   //带中文时间  年月时分
            return nUtils.getDateTimeDetail(time)
        },
        getDateDetail: function (time) { //年月日时分

            return nUtils.dateTime(time)
        },
        initData: function () {
            var afterGoodsInfo = window.localStorage.getItem("afterSaleGoodsInfo");
            if (afterGoodsInfo) {
                xpHome.afterSaleGoods = JSON.parse(afterGoodsInfo);
                //console.log("---xpHome.afterSaleGoods--",xpHome.afterSaleGoods)
            }
        },
        getAfterSaleType: function (order) {
            var status = "";
            switch (order) {
                case "0":
                    status = "等待处理";
                    break;
                case "1":
                    status = "处理中";
                    break;
                case "2"://
                    status = "等待关闭";
                    break;
                case "3"://
                    status = "已关闭";
                    break;

            }
            return status;
        },
        goOnLine: function () {  //断网刷新
            nUtils.onLine();
        },
        showTel: function (type) {
            if (type == 1) {
                dialog.alert({
                    title: "温馨提示",
                    msg: '小普客服 400-152-8518',
                    buttons: ['关闭']
                }, function (ret) {
                    console.log(ret)
                })
            } else {
                dialog.alert({
                    title: "温馨提示",
                    msg: '小普客服 400-152-8518',
                    buttons: ['关闭']
                }, function (ret) {
                    console.log(ret)
                })
            }


        }
    },


});

$(function(){
    xpHome.initData()
})

apiready = function () {
    api.parseTapmode();
}